using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using FoundationLib.Ifc.Domain;


namespace FoundationLib.Ifc.Domain 
{
	/// <summary>
	/// Abstract superclass for versioned events
	/// </summary>
	public abstract class VersionedEvent : IVersionedEvent 
	{
		/// <summary>
		/// The date and time when this event was created
		/// </summary>
		private DateTime created;
		/// <summary>
		/// The aggregate version
		/// </summary>
		private int version;

		/// <summary>
		/// Creates a new versioned event
		/// </summary>
		protected VersionedEvent()
		{
			this.created = DateTime.Now;
		}

		/// <summary>
		/// Gets the date and time when this event was created
		/// </summary>
		public DateTime Created
		{
			get
			{
				return this.created;
			}
		}

		/// <summary>
		/// Gets the version of the aggregate
		/// </summary>
		public int Version
		{
			get
			{
				return this.version;
			}
			set
			{
				this.version = value;
			}
		}

	}

}